<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: ren jian
  Date: 2021/12/25
  Time: 17:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书城首页</title>
</head>
<script type="text/javascript">
</script>
<base href="http://localhost:8080/OnlineBook/">
<style>
    td{width:100px;overflow:hidden}
</style>
<body>
<h1>当前图书系统所具有的所有图书</h1>
<H3>欢迎<span style="background-color: aqua" href="#">${sessionScope.user.sname}</span>光临书城</H3>
<a href="monsterServlet?action=allBook" style="color: blue">点击这里进入个人主页</a>
<%--<a href="bookServlet?action=allBook">点击此处加载数据</a>--%>
<div>
    <table align="center" border="1" cellspacing="0" cellpadding="0" height="200" >
        <tr>
            <th width="200">
                图书编号
            </th>
            <th>
                图书名称
            </th>
            <th>
                图书作者
            </th>
            <th>
                图书价格
            </th>
            <th>
                出版社
            </th>

            <td colspan="2">
                相关操作
            </td>
        </tr>
        <c:forEach items="${requestScope.books}" var="book">
            <tr>
                <td>
                    ${book.sn}
                </td>
                <td>
                    ${book.bname}
                </td>
                <td>
                    ${book.author}
                </td>
                <td>
                    ${book.price}
                </td>
                <td>
                    ${book.publish}
                </td>
                <td>
                    <a href="monsterServlet?action=addBook&sn=${book.sn}" style="color:brown" id="coll">收藏</a>
                    <a href="bookServlet?action=deleteBook&sn=${book.sn}" style="color: brown" id="delete">删除</a>
                    <a href="bookServlet?action=getBook&sn=${book.sn}" style="color:brown" >修改</a>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td>

            </td>
            <td>

            </td>
            <td>

            </td>
            <td>

            </td>
            <td>

            </td>
            <td>
                <a href="book_add.jsp" style="color: blueviolet">添加</a>
            </td>
        </tr>
    </table>
</div>
</body>
</html>
